import { lazy } from "react";

export const homerouter = [
    {
        path:"/home/home",
        element:lazy(()=>import("../page/homes/Home")),
        title:"首页"
    },
    {
        path:"/home/orderForGoods",
        element:lazy(()=>import("../page/homes/OrderForGoods")),
        title:"订单"
    },
    {
        path:"/home/customer",
        element:lazy(()=>import("../page/homes/Customer")),
        title:"客服"
    },
    {
        path:"/home/my",
        element:lazy(()=>import("../page/homes/My")),
        title:"我的"
    },
]
const routers = [
    // 重定向
     {
        path:"/",
        to:"/home/home"
    },
    // 总页面
    {
        path:"/home",
        element:lazy(()=>import("../page/Index")),
        children:homerouter
    },
    // 登录
    {
        path:"/loding",
        element:lazy(()=>import("../page/Longin"))
    },
    // 注册
    {
        path:"/register",
        element:lazy(()=>import("../page/Register"))
    },
    // 出发地
    {
        path:"/address",
        element:lazy(()=>import("../page/Address"))
    },
     // 目的地
    {
        path:"/addresstow",
        element:lazy(()=>import("../page/Addresstow"))
    },
    // 详情
    {
        path:"/detail/:id",
        element:lazy(()=>import("../page/Detail"))
    },
    // 支付详情
    {
        path:"/paymentdetails",
        element:lazy(()=>import("../page/Paymentdetails"))
    },
    // 订单填写
    {
        path:"/orderfilling",
        element:lazy(()=>import("../page/Orderfilling"))
    },
    // 列车查询列表
    {
        path:"/trainquery",
        element:lazy(()=>import("../page/Trainquery"))
    },
    // 404
    {
        path:"*",
        element:lazy(()=>import("../page/Error"))
    },
    // 乘客列表
    {
        path:"/passengerList",
        element:lazy(()=>import("../page/PassengerList"))
    },
    // 添加乘客
    {
        path:"/addpeople",
        element:lazy(()=>import("../page/Addpeople"))
    }
    
]
export default routers